import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false

//1、下载
//2、引入
import VueRouter from 'vue-router'
//3、注册组件
Vue.use(VueRouter)
//4、定义路由规则
let routes = [
  {
    path: "/",
    redirect: "/find"
  },
  {
    path: "/find",
    component: () => import("./views/find.vue")
  },
  {
    path: "/friend",
    component: () => import("./views/friend.vue")
  },
  {
    path: "/my",
    component: () => import("./views/my.vue")
  }
]
//5、根据路由规则生成路由对象
let router = new VueRouter({
  // routes:routes
  routes
})

//6、把路由对象注入到cue实例中
new Vue({
  // router:router,
  router,
  render: h => h(App),
}).$mount('#app')
